﻿<UserControl x:Class="VsSpeakerCompanion.UI.LoginControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:ClassModifier="internal" Height="330" >
    <UserControl.Resources>
        <Style x:Key="LabelTitle" TargetType="{x:Type Label}">
            <Setter Property="FontFamily" Value="Segoe UI" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="16" />
        </Style>
        <Style x:Key="TextBoxWithRoundedCornersStyle" TargetType="{x:Type TextBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                        <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10">
                            <ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TextBoxWithRoundedCornersStyleWithPrefix" TargetType="{x:Type TextBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                        <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10">
                            <ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost" Margin="10,0,0,0"  HorizontalAlignment="Left" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="PasswordBoxWithRoundedCornersStyle" TargetType="{x:Type PasswordBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type PasswordBox}">
                        <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10">
                            <ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <StackPanel>
            <Label Style="{StaticResource LabelTitle}">Twitter ID</Label>
            <TextBox Name="textBoxUsername" Style="{StaticResource TextBoxWithRoundedCornersStyle}" Margin="15,0,15,0" Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}" />
            <Label Style="{StaticResource LabelTitle}">Password</Label>
            <PasswordBox Name="textBoxPassword" Style="{StaticResource PasswordBoxWithRoundedCornersStyle}" Margin="15,0,15,0" Password="" />
            <Label Style="{StaticResource LabelTitle}">Conference</Label>
            <Grid>
                <TextBox Name="textBoxConference" Style="{StaticResource TextBoxWithRoundedCornersStyleWithPrefix}" Margin="15,0,15,0" Text="{Binding ConferenceHashcode, UpdateSourceTrigger=PropertyChanged}" />
                <TextBlock FontSize="16" FontFamily="SEGOE UI" FontWeight="Bold" Margin="18,0,0,0" Text="#" Foreground="Black" />
            </Grid>
            <Label Style="{StaticResource LabelTitle}">Session ID</Label>
            <Grid>
                <TextBox Name="textBoxSession" Style="{StaticResource TextBoxWithRoundedCornersStyleWithPrefix}" Margin="15,0,15,0" Text="{Binding SessionHashcode, UpdateSourceTrigger=PropertyChanged}" />
                <TextBlock FontSize="16" FontFamily="SEGOE UI" FontWeight="Bold" Margin="18,0,0,0" Text="#" Foreground="Black" />
            </Grid>
            <Label Style="{StaticResource LabelTitle}">Session Name</Label>
            <TextBox Name="textBoxSessionName" Style="{StaticResource TextBoxWithRoundedCornersStyle}" Margin="15,0,15,0" Text="{Binding SessionName, UpdateSourceTrigger=PropertyChanged}" />
            <Button HorizontalAlignment="Center" IsDefault="True" FontFamily="Segoe UI" FontSize="16" Foreground="White" Background="Black" Height="35" Width="120" Margin="0,30,0,0" Click="Button_Click">Start Session</Button>
        </StackPanel>
    </Grid>
</UserControl>
